﻿using BLL;
using Newtonsoft.Json.Linq;
using System;

namespace Thksoft.UserCotrols
{
    public partial class CtrlMonthDepartment1 : System.Web.UI.UserControl
    {
        protected void Page_Load(object sender, EventArgs e)
        {
            QS_PLANMonth_DEPARTMENTBLL planMonthDepartmentBll = new QS_PLANMonth_DEPARTMENTBLL();
            //BUSINESS_ID 转 ApplayId
            QS_PLANMONTHAPPLYBLL planMonthApplyBll = new QS_PLANMONTHAPPLYBLL();
            var bid = Request.Params.Get("BusinessId");
            var applay = planMonthApplyBll.FindByBuid(Convert.ToInt32(bid));
            Model = planMonthApplyBll.GetData((int)applay.N_MONTHAPP_ID);
            ApplyId = applay.N_MONTHAPP_ID.ToString();
            UserId = planMonthDepartmentBll.User.USER_ID.ToString();

            foreach (var item in Model)
            {
                switch (item["C_DETAILS_CODE"].ToString())
                {
                    case "T1":
                        item["C_IMAGE_URL"] = @"\App_Themes\MSN_Blue\ProImages\15\主营业收入.png";
                        break;

                    case "T2":
                        item["C_IMAGE_URL"] = @"\App_Themes\MSN_Blue\ProImages\15\天然气购入.png";
                        break;

                    case "T3":
                        item["C_IMAGE_URL"] = @"\App_Themes\MSN_Blue\ProImages\15\安装外包费用.png";
                        break;

                    case "T4":
                        item["C_IMAGE_URL"] = @"\App_Themes\MSN_Blue\ProImages\15\材料费用.png";
                        break;

                    case "T5":
                        item["C_IMAGE_URL"] = @"\App_Themes\MSN_Blue\ProImages\15\大修费用.png";
                        break;

                    case "T6":
                        item["C_IMAGE_URL"] = @"\App_Themes\MSN_Blue\ProImages\15\城市管网项目.png";
                        break;

                    default:
                        item["C_IMAGE_URL"] = null;
                        break;
                }
            }
        }

        public JArray Model = null;

        protected void ReLoadBtn_Click(object sender, EventArgs e)
        {
        }

        public string ApplyId;
        public string UserId;
    }
}